package com.gzbit.calculater.ui;


import com.gzbit.calculater.bll.*;
import com.gzbit.calculater.Factory.*;
import com.gzbit.calculater.simplefactory.*;
import java.util.Scanner;

public class Test {

    public static void main(String[] args) throws Exception {
        int numberA,numberB, result;
        String oprType;
        Scanner scanner = new Scanner(System.in);
        numberA = scanner.nextInt();
        numberB = scanner.nextInt();
        oprType=scanner.next();
        IOperation<Integer> opr= null;
        IFactory<Integer> factory =null;

        switch (oprType){
            case"+":
                factory=new AddFactory<Integer>();
                break;
            case"-":
                factory=new SubFactory<Integer>();
                break;
            default:
                throw new Exception("输入的运算符号错误");
        }
        opr = factory.getOperation();

        opr.setValue(numberA,numberB);
        result=opr.getResult();
        System.out.println(result);
        }
    }


